+<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/11/9
  Time: 14:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <base href="${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}">
    <title>蔬菜进口单查询</title>
   <script>
      function del() {
          confirm("确定要删除此消息吗？")
      }
   </script>
</head>
<body>
    <h3>蔬菜进口管理系统</h3>
    <table cellspacing="0" cellpadding="0" border="1">
        <tr>
            <td>蔬菜进口单编号</td>
            <td>蔬菜种类</td>
            <td>数量</td>
            <td>编辑</td>
            <td>删除</td>
        </tr>
        <c:if test="${not empty LIST}">
            <c:forEach items="${LIST}" var="list">
                <tr>
                    <td>${list.vid}</td>
                    <td>${list.name}</td>
                    <td>${list.quantity}</td>
                    <td><a href="vegetableServlet/querylist?id=${list.vid}">编辑</a></td>
                    <td><a href="vegetableServlet/delete?vegetableid=${list.vid}" onclick="del()">删除</a></td>
                </tr>

            </c:forEach>
            <c:set value="${MODEL.pageIndex }" scope="page" var="cp"></c:set>
            <c:set value="${MODEL.pageCounts }" scope="page" var="max"></c:set>
            <tr>
                <td colspan="9" align="center">
                    <a href="${pageContext.request.contextPath }/vegetableServlet/query?currentPage=1">首页</a>
                    <c:if test="${cp!=1}">

                        <a href="${pageContext.request.contextPath }/vegetableServlet/query?currentPage=${cp-1}">上一页</a>
                    </c:if>
                    <c:if test="${cp==1 }">上一页</c:if>
                    <c:if test="${cp!=max }">
                        <a href="${pageContext.request.contextPath }/vegetableServlet/query?currentPage=${cp+1}">下一页</a>
                    </c:if>
                    <c:if test="${cp==max }">下一页</c:if>
                    <a href="${pageContext.request.contextPath }/vegetableServlet/query?currentPage=${max}">末页</a>
                </td>
            </tr>
        </c:if>
        <c:if test="${empty LIST }">
            <tr>
                <td colspan="5">
                    蔬菜进口单为空，请先添加！
                </td>
            </tr>
        </c:if>
    </table>
</body>
</html>
